import Vue from 'vue'
import Router from 'vue-router'
import home from '@/components/home' //首页
import login from '@/components/login' //登录
import aboutUs from '@/components/aboutUs/setting' //关于我们
import companyInfo from '@/components/aboutUs/companyInfo' //关于我们
import problem from '@/components/aboutUs/problem' //关于我们
import important from '@/components/aboutUs/important' //关于我们
import userAgreement from '@/components/aboutUs/userAgreement' //关于我们
import joinUs from '@/components/aboutUs/joinUs'
import contactUs from '@/components/aboutUs/contactUs'
import findshop from '@/components/findshop'
import shangpu from '@/components/shangpu'
import details from '@/components/details'
import setting from '@/components/myShop/setting'
import myshop from '@/components/myShop/myshop'
import push from '@/components/myShop/push'
import pushneed from '@/components/myShop/pushneed'
import myneed from '@/components/myShop/myneed'
import qiuzu from '@/components/qiuzu'
import more from '@/components/morePage'
import mycollect from '../components/myShop/mycollect'
import myhistory from '../components/myShop/myhistory'
import myidea from '../components/myShop/myidea'
import myinfo from '../components/myShop/myinfo'
Vue.use(Router)

export default new Router({
  // mode: 'history',
  routes: [{
    path: "/",
    redirect: "/home"
  },
    {
      path: '/home',
      name: 'home',
      component: home,
    },{
      path: '/findshop',
      name: 'findshop',
      component: findshop,
    },{
      path: '/shangpu',
      name: 'shangpu',
      component: shangpu,
    },
    {
      path: '/login',
      name: 'login',
      component: login,
    },{
      path: '/details:name/:id',
      name: 'details',
      component: details,
    },{
      path: '/qiuzu/:id',
      name: 'qiuzu',
      component: qiuzu,
    },{
      path: '/push',
      name: 'push',
      component: push,
    },{
      path: '/setting',
      name: 'setting',
      component: setting,
      children: [{
        path: 'myshop',
        name: 'myshop',
        component: myshop,
      },{
        path: 'myneed',
        name: 'myneed',
        component: myneed,
      },
        {
          path: 'pushneed',
          name: 'pushneed',
          component: pushneed,
        },{
          path: 'push',
          name: 'push',
          component: push,
        },{
          path:'myidea',
          name:'myidea',
          component:myidea
        },
        {
          path:'myinfo',
          name:'myinfo',
          component:myinfo
        },
        {
          path:'myhistory',
          name:'myhistory',
          component:myhistory
        },
        {
          path:'mycollect',
          name:'mycollect',
          component:mycollect
        }]
    }, {
      path: '/aboutUs',
      name: 'aboutUs',
      component: aboutUs,
      children: [{
        path: '/companyInfo',
        name: 'companyInfo',
        component: companyInfo,
      },{
        path: '/problem',
        name: 'problem',
        component: problem,
      },{
        path: '/important',
        name: 'important',
        component: important,
      },{
        path: '/userAgreement',
        name: 'userAgreement',
        component: userAgreement,
      },{
        path: '/joinUs',
        name: 'joinUs',
        component: joinUs,
      },{
        path: '/contactUs',
        name: 'contactUs',
        component: contactUs,
      }]
    },
    {
      path:'/service',
      name:'service',
      component:more,
    },
    {
      path:'/myidea',
      name:'myidea',
      component:myidea
    },
    {
      path:'/myinfo',
      name:'myinfo',
      component:myinfo
    },
    {
      path:'/myhistory',
      name:'myhistory',
      component:myhistory
    },
    {
      path:'/mycollect',
      name:'mycollect',
      component:mycollect
    },
    {
      path:'/more',
      name:'more',
      redirect: '/service'
    }
  ]
})
